package com.cwt_taxi_xa.db.bll;

import android.content.Context;

import com.cwt_taxi_xa.db.dal.EventDao;
import com.cwt_taxi_xa.model.EventInfo;

import java.util.ArrayList;

public class EventBiz {

	private EventDao dao;
//	private Context context;

	public EventBiz(Context context) {
//		this.context = context;
		dao = new EventDao(context);
	}

	public int updateReadStatus(int id){
		return dao.updateReadStatus(id);
	}

	public int updateDownStatus(int id){
		return dao.updateDownStatus(id);
	}

	/**
	 * 获取总条数
	 * @author ferch
	 * @return
	 */
	public int getCount() {
		return dao.getCount();
	}

	public ArrayList<EventInfo> getEvents(int currentPage, int pageCount){
		return dao.getEvents(currentPage, pageCount);
	}

	/**批量添加*/
	/*public int addEvents(ArrayList<EventInfo> infos){
		return dao.save(infos);
	}*/

	/**批量修改*/
	public int updateEvents(ArrayList<EventInfo> infos){
		return dao.update(infos);
	}

	/**先清空后批量添加*/
	/*public int refreshEvents(ArrayList<EventInfo> infos){
		return dao.refresh(infos);
	}*/

	/**
	 * 删除事件
	 * @return
	 */
	public int delete(ArrayList<EventInfo> infos){
		return dao.delete(infos);
	}

	/**清空*/
	public int clearEvents(){
		return dao.clear();
	}
}
